package net.guoyixian.admin.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.web.util.WebUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class IndexController extends BaseController{

	@RequestMapping("main")
	public ModelAndView main(HttpServletRequest request,
			HttpServletResponse response) {
		String url2 = request.getRequestURI();
		
		String url = WebUtils.getSavedRequest(request)!=null?WebUtils.getSavedRequest(request).getRequestUrl():"pages/center.jsp";
		
		ModelAndView mv = new ModelAndView("main");
		mv.addObject("referurl", url);
		
		return mv;
	}
	
	@RequestMapping("left")
	public String left() {
		return "left";
	}
	
	@RequestMapping("index")
	public String index() {
		return "index";
	}
	
	@RequestMapping("top")
	public String top() {
		return "top";
	}
	/**
	 * 403拒绝访问
	 * @return
	 */
	@RequestMapping("403")
	public String forbidden() {
		return "403";
	}
}